package secondStage.part2.API_Study;

/**
 * @ClassName: [System_learn]
 * @Description: System
 * @Author: [黄劲松]
 * @CreateDate: [2021-03-28]
 * @Version: [v1.0]
 */
/*System类的常用方法
public static void exit(int status)
        终止当前运行的Java虚拟机，非零表示异常终止
public static long currentTimeMillis()
        返回当前时问(以毫秒为单位)*/
public class System_learn {
    public static void main(String[] args) {
        /*System.out.println("开始");
        System.exit(0);//终止当前运行的Java虚拟机，非零表示异常终止
        System.out.println("结束");*/

        System.out.println(System.currentTimeMillis()
                * 1.0 / 1000 / 60 / 60 / 24 / 365 + "年");
        long start = System.currentTimeMillis();
        for (int i = 0; i < 1000; i++) {
            System.out.println(i);
        }
        long end = System.currentTimeMillis();
        System.out.println("共耗时间：" + (end - start) + "毫秒");
    }
}
